
package com.be.beadmin.product.service;

import com.be.beadmin.basicData.entity.User;
import com.be.beadmin.common.entity.PageEntity;
import com.be.beadmin.design.entity.ProductDrawingInfo;
import com.be.beadmin.product.dto.input.WorkOrderAndProduct;
import com.be.beadmin.product.dto.input.WorkOrderInforDto;
import com.be.beadmin.product.dto.output.ProductManufactInforEx;
import com.be.beadmin.product.dto.output.WorkOrderInforByBpEx;
import com.be.beadmin.product.dto.output.WorkOrderInforEx;
import com.be.beadmin.product.entity.WorkOrderInfor;
import com.be.beadmin.project.entity.BatchProduct;
import org.springframework.data.domain.Page;

import javax.servlet.http.HttpServletRequest;
import java.util.ArrayList;
import java.util.List;

/**
* @description 服务接口
* @author zjm
* @date 2023-03-30
**/
public interface WorkOrderInforService {

    /**
    * 分页的查询接口
    * @param pageEntity
    * @return
    */
    Page<WorkOrderInforEx> getWorkOrderInforByPage(HttpServletRequest request,PageEntity pageEntity);

    List<WorkOrderInfor> getWorkOrderInforExtendWarnByPage();
    /**
     * 根据id获取工单
     * @param id
     * @return
     */
    WorkOrderInfor getWorkOrderInforById(String id);

    /**
     * 查询已经释放的工单
     * @param pageEntity
     * @return
     */
    Page<WorkOrderInforEx> getWorkOrderInforReleasedByPage(HttpServletRequest request ,PageEntity pageEntity);
    /**
     * 分页的查询接口
     * @param pageEntity
     * @return
     */
    Page<WorkOrderInforEx> getWorkOrderInforObjectByPage(HttpServletRequest request, PageEntity pageEntity);

    /**
    * @param workOrderInforDto
    */
    void addWorkOrderInfor(WorkOrderInforDto workOrderInforDto);

    /**
    * @param workOrderInforDto
    */
    void updateWorkOrderInfor(WorkOrderInforDto workOrderInforDto);

    /**
    * @param id
    */
    void delWorkOrderInfor(String id);

    /**
    * 删除多个角色
    * @param ids
    */
    void delWorkOrderInfors (List<String> ids);






    /**获取工单的图纸信息
     *
     * @param workOrderInfoId
     * @return
     */
    List<ProductDrawingInfo> getDrawingInfo(String workOrderInfoId);

    /**
     * 获取工单的生产进度信息
     * @param workOrderInfoId
     * @return
     */
    List<ProductManufactInforEx> getManufactInfo(String workOrderInfoId);

    /**
     * 分页的查询接口扩展
     * @param pageEntity
     * @return
     */
    Object getWorkOrderInforExtendByPage(HttpServletRequest request ,PageEntity pageEntity);

    /**
     * 工单的项目团队经理
     * @param workOrderInfoId
     * @return
     */
    User getTeamManager(String workOrderInfoId);

    /**
     * 工单的项目团队成员
     * @param workOrderInfoId
     * @return
     */
    List<User> getTeamMember(String workOrderInfoId);

    List<WorkOrderInfor> getWorkOrderInforList();

    List<WorkOrderInfor>  getWorkOrderInforListByInfoId(String infoId);

    /**
     * 获取所有工单和柜体别名对应信息
     * @return
     */
    List<WorkOrderAndProduct> getWorkOrderInforAndproductName();

    User  getTeamManufactManager(String workOrderInfoId);

    /**
     * 根据工单设置工单排程状态
     * @param workOrderInfor
     * @param scheduledFlag
     */
    void setWorkOrderScheduledFlag(WorkOrderInfor workOrderInfor, int scheduledFlag);

    /**
     * 根据柜体设置工单排程状态
     * @param batchProduct
     * @param scheduledFlag
     */
    void setWorkOrderScheduledFlag(BatchProduct batchProduct, int scheduledFlag);

    /**
     * 根据批次计划ID获取工单列表
     * @param batchPlanId
     * @return
     */
    List<WorkOrderInforByBpEx> getWorkOrderInforByBatchPlanId(String batchPlanId);

    /**
     * 根据批次计划ID获取已排程工单列表
     * @param batchPlanId
     * @return
     */
    List<WorkOrderInforByBpEx> getWorkOrderInforByBatchPlanIdAndScheduled(String batchPlanId);

    /**
     * 根据批次计划ID获取未排程工单列表
     * @param batchPlanId
     * @return
     */
    List<WorkOrderInforByBpEx> getWorkOrderInforByBatchPlanIdAndUnscheduled(String batchPlanId);

    /**
     * 获取工单进度
     * @return
     */
    ArrayList<Integer> getWorkOrderInforProgress();


    WorkOrderInfor getWorkOrderInforByWo(String wo);

    /**
     * 删除所有工单
     * @param id
     */
    void deleteWoByInfo(String id);

    String getDrawingPreviewUrl(String productDrawingInfoId);

    /**
     * 获取所有工单编号
     * @return
     */
    List<String> getWos(String s);


    List<Integer> countYearMonthWorkOrderInforByDate(Integer month, Integer year);


    /**
     * 根据项目编码获取工单编号列表
     * @param projectCode
     * @return
     */
    List<String> getWoListByProjectCode(String projectCode);
}